<template>
	<view class="box">
		<text>消息弹窗</text>
		<button type="default" @click="displays">显示</button>
		<button type="default" @click="hide">隐藏</button>
		<button type="default" @click="lodings">加载中...</button>
		<button type="default" @click="lodings_no">两秒后取消加载</button>
		<button type="default" @click="showmodals">显示模态弹窗选择弹窗</button>
		<button type="default" @click="achtions">从底部向上弹出操作菜单</button>
	</view>
</template>

<script setup>
	function displays() {
		uni.showToast({
			title: '最多只能七个字',
			image: "../../static/dongtu.gif",
			duration:3000
		})
	}
	function hide(){
		uni.hideToast()
	}
	function lodings(){
		uni.showLoading({
			title:"加载中..."
		})
	}
	function lodings_no(){
		setTimeout(()=>{
			uni.hideLoading()
		},2000)
	}
	function showmodals(){
		uni.showModal({
			title:"是否选择",
			content:"选择按钮",
			success: (res) => {
				console.log(res)
				uni.showToast({
					title:"您已确认！"
				})
			},
			fail: (res) => {
				console.log(res)
				uni.showToast({
					title:"您已取消！fail"
				})
			},
			complete: (res) => {
				console.log(res)
				uni.showToast({
					title:"执行成功！complete"
				})
			},
			editable:true,
			placeholderText:"请输入手机号！"
		})
	}
	let arrs = ["数字1","数字2","数字3","数字4"];
	function achtions(){
		uni.showActionSheet({
			title:"请选择",
			itemList:arrs,
			success: (res) => {
				
				console.log(res)
				console.log(arrs[res.tapIndex])
			}
		})
	}
</script>

<style lang="scss" scoped>

</style>